﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//using System.Web.WebPages;
using CCH.DAO;
using CCH.Entity;

public partial class _1004_1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            if (Request["you_no"] != null && Request["you_no"] != "")
            {
                int you_no = 0;
                int.TryParse(Request["you_no"], out you_no);
                this.PlayMoive(you_no);
            }
        }
    }

    private void PlayMoive(int you_no)
    {
        var data = new youtubeDAO().Get_youtube(you_no);
        if (data != null)
        {
            string link = "http://www.youtube.com/watch?v=" + data.you_code;

            this.div_youtube.InnerHtml = YouTube.Helper.NobelHelpers.Youtube(link, 0, 1, 640, 390).ToHtmlString();
            this.lab_name.Text = data.you_name;
            this.lab_titlename.Text = data.you_name;
            this.div_desc.InnerHtml = data.you_describe;
        }
        else
        {
            this.lab_name.Text = "找不到影片";
            this.div_desc.InnerHtml = "";
            this.div_youtube.InnerHtml = "";
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("1004.aspx");
    }
}